function [s_jk2, stay_vec] = predict_s_jk2(p_jk2, s1_ind1_jj, Delta_xi_jj, U_lapse,...
    resource_y2, pr_y, B2_c, alpha, rho, crra)

c2 = resource_y2-p_jk2; % N_y x 1

% second-period utility in each state k if not lapse 
U_stay = B2_c*(alpha*u_c(c2,rho,crra) +  Delta_xi_jj); % N_y x 1

% lapse+edit: force termination if c2<1, i.e., cannot afford p2
force_lapse = (c2<1); % N_y x 1

% lapse+edit: predict lapse probability
lapse_vec = exp(U_lapse)./(exp(U_stay) + exp(U_lapse)); %N_y x 1
lapse_vec(force_lapse==1) = 1;

% stay probability 
stay_vec = 1 - lapse_vec; % N_y x 1

% 2nd-period market share conditional on p_jk2, s_jk2(p_jk2)
s_jk2 = sum(s1_ind1_jj.*stay_vec.*pr_y); % scalar
